﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Luminji.Core.Enterprise;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.Practices.Unity;
using Microsoft.Practices.Unity.Configuration;

namespace Luminji.Core.UnitTest.Unity
{
    [TestClass]
    public class UnityHelperTest
    {
        //Because of read file, so ignor
        [TestMethod]
        public void TestMethod1()
        {
            IUnityContainer container = new UnityContainer();
            container.RegisterType<ISampleClass, SampleClass>(); 
            var re = UnityObjectFactory.GetInstance<ISampleClass>(container);
            Assert.AreEqual(re.Name, "Sample");
        }
    }

    public interface ISampleClass
    {
        string Name { get; set; }
    }

    public abstract class BaseClass<T>
    {
        
    }

    public class Xxx
    {
        
    }

    public class SampleClass: BaseClass<Xxx>, ISampleClass
    {
        public SampleClass()
        {
            Name = "Sample";
        }
        public string Name
        {
            get; set;
        }
    }
}
